<?php
namespace Cyfy;

/**
 * AJAX calls.
 *
 * Class, that is used when AJAX request through /ajax.php is called.
 *
 * @category cyfy
 * @author Dandelion <dandelion8888@gmail.com>
 * @version 0.1
 */ 
class Ajax
{
    /**
     * Method, which processes the query. Calls method $module :: ajax($ajax)
     *
     * @param string Module to be called
     * @param string AJAX callback name
     * @return mixed An array or string, if operation was successful, FALSE otherwise.
     */ 
    static function process($module, $ajax)
    {	
        $class = "\Cyfy\Modules\\" . $module . "\Module";
        if(method_exists($class, "ajax"))
        {
            return $class :: ajax($ajax);		
        }
        return false;
    }

}
